#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
int nnum[10] = { 0 };
void GetScore(int* p, float* avg, int* num)
{
	int j = 0;
	int i = 0;
	int sum = 0;
	for (i = 0; i < 10; i++)
	{
		sum = sum + *(p + i);
	}
	*avg = (float)sum / 10;
	for (i = 0; i < 10; i++)
	{
		if (((float)(*(p + i))) < *avg)
		{
			nnum[j++] = *(p + i);
			(*num)++;
		}
	}
}
int main()
{
	srand(824);
	float avg = 0.0f;
	int num = 0;
	int arr[10] = { 0 };
	int i = 0;
	for (i = 0; i < 10; i++)
	{
		arr[i] = rand() % 101;
	}
	GetScore(arr, &avg, &num);
	for (i = 0; i < 10; i++)
	{
		printf("%d ", *(arr + i));
	}
	printf("\n");
	printf("avg=%.1f num=%d\n", avg, num);
	for (i = 0; nnum[i]; i++)
	{
		printf("%d ", nnum[i]);
	}
	return 0;
}